<?php

class Talktangle_PaymentController extends Core_Controller_Action_Standard
{
  public function indexAction()
  {
    if( !$this->_helper->requireUser()->isValid() ) {
		return;
	}
    $viewer = Engine_Api::_()->user()->getViewer();
    if (!Engine_Api::_()->core()->hasSubject()){
        Engine_Api::_()->core()->setSubject($viewer);
    }
    $this->_helper->content->setNoRender()->setEnabled();
  }
  
  
  public function returnbuyAction(){
      $paymentApi = Engine_Api::_()->getApi('payment','talktangle');
      $paymentApi->onTransactionReturn($this->_getAllParams());
      
      $this->view->url = $url =  Zend_Controller_Front::getInstance()->getRouter()
                        ->assemble(array('controller'=>'index','action'=>'index'), 'talktangle_extended', true);
       header("Location: $url"); 
       die;       
    
  }
  
}
